<?php
$params = array_merge(
    require __DIR__ . '/../../common/config/params.php',
    require __DIR__ . '/../../common/config/params-local.php',
    require __DIR__ . '/params.php',
    require __DIR__ . '/params-local.php'
);

$config = [
    'id' => 'app-fztadmin',
    'name' => '分账通可视化后台',
    'basePath' => dirname(__DIR__),
    'controllerNamespace' => 'fztadmin\controllers',
    'timeZone' => 'PRC',   //中国时区
    'charset' => 'UTF-8',   //默认, 万国码
    'language' => 'zh-CN',   //简体中文
    'bootstrap' => ['log'],
    'components' => [
        'request' => [
            'csrfParam' => '_csrf-fztadmin',
        ],
        'user' => [
            'identityClass' => 'common\models\db\User',
            'enableAutoLogin' => true,
            'identityCookie' => ['name' => '_identity-fztadmin', 'httpOnly' => true],
        ],
        'session' => [
            'name' => 'advanced-fztadmin',
        ],
//        'log' => [
//            'traceLevel' => YII_DEBUG ? 3 : 0,
//            'targets' => [
//                [
//                    'class' => 'yii\log\FileTarget',
//                    'levels' => ['error', 'warning'],
//                ],
//            ],
//        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
    ],
    'as access' => [
        'class' => 'fztadmin\behaviors\RBAC',
        'except' => [
            'gii/*',
            'debug/*',
            'site/*',
            'public/*',
        ],
        'rules' => [
            [
                'allow' => true,
                'roles' => ['@'],
            ],
        ],
    ],
    'modules' => [
        'gridview' => ['class' => 'kartik\grid\Module'],
        'ajax' => ['class' => 'fztadmin\modules\ajax\AjaxModule'],
        'rbac' => ['class' => 'fztadmin\modules\rbac\RbacModule'],
        'system' => ['class' => 'fztadmin\modules\system\SystemModule'],
        'user' => ['class' => 'fztadmin\modules\user\UserModule'],
        'platform' => ['class' => 'fztadmin\modules\platform\PlatformModule'],
        'custom' => ['class' => 'fztadmin\modules\custom\CustomModule'],
    ],
    'params' => $params,
];

$urlManagers = require(Yii::getAlias('@common/config/url-managers.php'));
$config['components']['urlManager'] = $urlManagers['urlManagerFztadmin'];

return $config;
